home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH4 / 4-1-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-11-02  |  1.8 KB  |  59 lines

  1. VERSION 5.00
  2. Begin VB.Form frm4_1_2 
  3.    Caption         =   "Arithmetic"
  4.    ClientHeight    =   1680
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   3690
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1680
  20.    ScaleWidth      =   3690
  21.    Begin VB.PictureBox picResult 
  22.       Height          =   855
  23.       Left            =   120
  24.       ScaleHeight     =   795
  25.       ScaleWidth      =   3435
  26.       TabIndex        =   1
  27.       Top             =   120
  28.       Width           =   3495
  29.    End
  30.    Begin VB.CommandButton cmdAdd 
  31.       Caption         =   "Add Numbers"
  32.       Height          =   375
  33.       Left            =   600
  34.       TabIndex        =   0
  35.       Top             =   1200
  36.       Width           =   2415
  37.    End
  38. Attribute VB_Name = "frm4_1_2"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdAdd_Click()
  44.   'Display the sum of two numbers
  45.   picResult.Cls
  46.   Call ExplainPurpose
  47.   picResult.Print
  48.   Call Add(2, 3)
  49. End Sub
  50. Private Sub Add(num1 As Single, num2 As Single)
  51.   'Display numbers and their sum
  52.   picResult.Print "The sum of"; num1; "and"; num2; "is"; num1 + num2
  53. End Sub
  54. Private Sub ExplainPurpose()
  55.   'Explain the task performed by the program
  56.   picResult.Print "This program displays a sentence"
  57.   picResult.Print "identifying two numbers and their sum."
  58. End Sub
  59.